package demo.equals;

import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * 2022/5/13 15:15
 *
 * @author by yd
 */
@Data
@Accessors(chain = true)
public class Father {
	private String id;

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;

		if (o == null || getClass() != o.getClass()) return false;

		Father father = (Father) o;

		return new EqualsBuilder().append(id, father.id).isEquals();
	}

	@Override
	public int hashCode() {
		return new HashCodeBuilder(17, 37).append(id).toHashCode();
	}

	public static void main(String[] args) {

		System.out.println(RandomUtils.nextInt(1, 10));
	}
}
